
/**
 * 通过哈希表来保存已存在的元素，然后判断是否有出现过，有则返回
 * https://leetcode.cn/problems/contains-duplicate/?envType=study-plan&id=shu-ju-jie-gou-ru-men&plan=data-structures&plan_progress=x5efsazv
 * @param {number[]} nums
 * @return {boolean}
 */
var containsDuplicate = function(nums) {
    let uniq=[];
    for(let i=0;i<nums.length;i++){
        if(!uniq.includes(nums[i])){
            uniq.push(nums[i])
        }else{
            return true;
        }
    }
    return false;
};